package releasemanager.properties.panels;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.team.svn.core.svnstorage.SVNRemoteStorage;

public class RepositoryProperties extends Composite {

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	
	private Combo combo;
	
	public RepositoryProperties(Composite parent, int style) {
		super(parent, style);
		setLayout(new GridLayout(1, false));
		
		Group grpRepositorie = new Group(this, SWT.BORDER);
		grpRepositorie.setText("Repositorie");
		grpRepositorie.setLayout(new GridLayout(1, false));
		grpRepositorie.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
		
		Label lblNewLabel = new Label(grpRepositorie, SWT.NONE);
		lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
		lblNewLabel.setText("Chose where will be change management repository data stored. ");
		
		combo = new Combo(grpRepositorie, SWT.NONE);
		combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		combo.setBounds(0, 0, 93, 21);
		
	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}
	
	public void fillRepositoriesCombo(){
		
		for(int i=0;i<SVNRemoteStorage.instance().getRepositoryLocations().length;i++){
			combo.add(SVNRemoteStorage.instance().getRepositoryLocations()[i].getLabel());
		}
		
	}
	
}
